﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Docx2Epub.Util;

namespace Docx2Epub.Docx
{
    class DocSection : DocHeading
    {
        private List<int> sectionNumber;

        public DocSection(string title, int lvl, IEnumerable<int> sectionNumber)
        {
            this.Title = title;
            this.sectionNumber = new List<int>(sectionNumber);
            this.Level = lvl;
        }

        public List<int> SectionNumber { get { return sectionNumber; } }

        public string SectionNavigationId { get { return "section" + OrderNumber; } }

        public override string OrderNumber
        {
            get { return this.sectionNumber.JoinAsString("."); }
        }

        public override string ToString()
        {
            return "Section " + OrderNumber + ". :" + this.Title;
        }

        public override string HeadingHtmlLink
        {
            get { return string.Format("chapter{0:000}.xhtml#", sectionNumber[0]) + SectionNavigationId; }
        }
    }
}
